#pragma once

#include "../SGD Wrappers/SGD_Geometry.h"	// Rectangle type

#include "../SGD Wrappers/SGD_Event.h"

class GameObject // IEntity
{
protected:
	SGD::Vector gravity = SGD::Vector(0, 966.2f);
	bool gravityOn = false;
	SGD::Point			m_ptPosition = SGD::Point{ 0, 0 };		// 2D position
	SGD::Size			m_szSize = SGD::Size{ 0, 0 };		// 2D size

public:
	GameObject() = default;
	virtual ~GameObject() = default;

	/**********************************************************/
	// Interface:
	//	- pure virtual methods MUST be overridden
	virtual void	Update(float elapsedTime) = 0;
	virtual void	Render(void) = 0;

	virtual SGD::Rectangle GetRect(void)	const = 0;
	virtual SGD::Rectangle GetActiveRect(void)	const = 0;

	virtual int		GetType(void)	const = 0;
	virtual void	HandleCollision(GameObject* pOther) = 0;
	virtual void	HandleEvent(const SGD::Event* pEvent) = 0;
	/**********************************************************/
	// Reference Counting:
	//	- track how many 'owners' are pointing to this Object
	virtual void	AddRef(void) = 0;
	virtual void	Release(void) = 0;

	virtual SGD::Point			GetPosition(void) const			{ return m_ptPosition; }
	virtual SGD::Size			GetSize(void) const				{ return m_szSize; }

	virtual void SetPosition(SGD::Point	pos) 			{ m_ptPosition = pos; }
	void SetGravityState(bool on) { gravityOn = on; }
};

